package com.icinfo.cloud.provider.punish.common.documentoperate.controller;

import com.icinfo.cloud.provider.punish.common.documentoperate.dto.CorrectionDocQueryDto;
import com.icinfo.cloud.provider.punish.common.documentoperate.service.ICaseCorrectionService;
import com.icinfo.cloud.provider.punish.common.documentoperate.vo.CorrectionDocQueryVo;
import com.icinfo.cloud.provider.punish.common.documentoperate.vo.CorrectionDocTemporaryVo;
import com.icinfo.framework.common.web.Result;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Desc 补正/更正
 * @Author mahan
 * @Date 2023/2/23
 */

@RestController
@RequestMapping("/punish/document/correction")
public class CaseCorrectionController {


	@Resource
	private ICaseCorrectionService caseCorrectionService;

	/**
	 * 描述：获取补正/更正文书信息目录编码
	 *
	 */
	@PostMapping("/getCorrectionDocCatalogCode")
	public Result<CorrectionDocQueryVo> getCorrectionDocCatalogCode(@RequestBody @Validated CorrectionDocQueryDto dto) {
		Result<CorrectionDocQueryVo> reVo = caseCorrectionService.getCorrectionDocCatalogCode(dto);
		return reVo;
	}

	/**
	 * 描述：补正/更正暂存修改时，获取文书记录ID和编码
	 *
	 */
	@PostMapping("/getCorrectionDocTemporary")
	public Result<CorrectionDocTemporaryVo> getCorrectionDocTemporary(@RequestBody @Validated CorrectionDocQueryDto dto) {
		CorrectionDocTemporaryVo reVo = caseCorrectionService.getCorrectionDocTemporary(dto);
		return Result.success(reVo);
	}

}
